﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class About : System.Web.UI.Page
{
    DAL dl = new DAL();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (User.Identity.IsAuthenticated)
        {
            List<DateResultTest> drt = dl.SelectDataToTable(User.Identity.Name);
            rptStatic.DataSource = drt;
            rptStatic.DataBind();
        }
    }
    protected void rptStatic_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        DateResultTest kvp = (DateResultTest)e.Item.DataItem;
        Label ln = e.Item.FindControl("lblTestName") as Label;
        Label lr = e.Item.FindControl("lblResult") as Label;
        Label ld = e.Item.FindControl("lblDate") as Label;
        if (ln != null && lr != null && ld != null)
        {
            ln.Text = kvp.TestName;
            lr.Text = kvp.TestResult;
            ld.Text = kvp.Date.ToString();
        }
    }
}
